package xyz.chaobei.feature.utils;

import java.util.function.Function;

/**
 * @copyright (C), 2015-2020
 * @fileName: FunctionTest
 * @author: MRC
 * @date: 2021/2/3 22:53
 * @description:
 */
public class FunctionTest {

    public static void main(String[] args) {

        // 链式转换
        Function<String,Integer> stringToInteger = Integer::valueOf;
        // andThen 将前一个处理的返回值作为后一个处理的入参
        Function<String,String> integerToString = stringToInteger.andThen(Integer::toHexString);

        String hex = integerToString.apply("123");
        System.out.println(hex);
    }

}
